<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .boxA {
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: red;
            width: calc(100% - 20px);
            height: calc(50vw - 10px);
        }
    </style>
</head>
<body>
    <div class="boxA">312321</div>
    <!-- A元素垂直居中
    A元素距离屏幕左右各边各10px
    A元素里的文字font—size:20px,水平垂直居中
    A元素的高度始终是A元素宽度的50%  -->

</body>
</html>